
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module demjson</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>demjson</strong></big></big> (version 1.3, 2008-03-19)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="demjson.py">demjson.py</a></font></td></tr></table>
    <p><tt>A&nbsp;<a href="#JSON">JSON</a>&nbsp;data&nbsp;encoder&nbsp;and&nbsp;decoder.<br>
&nbsp;<br>
This&nbsp;Python&nbsp;module&nbsp;implements&nbsp;the&nbsp;<a href="#JSON">JSON</a>&nbsp;(<a href="http://json.org/">http://json.org/</a>)&nbsp;data<br>
encoding&nbsp;format;&nbsp;a&nbsp;subset&nbsp;of&nbsp;ECMAScript&nbsp;(aka&nbsp;JavaScript)&nbsp;for&nbsp;encoding<br>
primitive&nbsp;data&nbsp;types&nbsp;(numbers,&nbsp;strings,&nbsp;booleans,&nbsp;lists,&nbsp;and<br>
associative&nbsp;arrays)&nbsp;in&nbsp;a&nbsp;language-neutral&nbsp;simple&nbsp;text-based&nbsp;syntax.<br>
&nbsp;<br>
It&nbsp;can&nbsp;encode&nbsp;or&nbsp;decode&nbsp;between&nbsp;<a href="#JSON">JSON</a>&nbsp;formatted&nbsp;strings&nbsp;and&nbsp;native<br>
Python&nbsp;data&nbsp;types.&nbsp;&nbsp;Normally&nbsp;you&nbsp;would&nbsp;use&nbsp;the&nbsp;<a href="#-encode">encode</a>()&nbsp;and&nbsp;<a href="#-decode">decode</a>()<br>
functions&nbsp;defined&nbsp;by&nbsp;this&nbsp;module,&nbsp;but&nbsp;if&nbsp;you&nbsp;want&nbsp;more&nbsp;control&nbsp;over<br>
the&nbsp;processing&nbsp;you&nbsp;can&nbsp;use&nbsp;the&nbsp;<a href="#JSON">JSON</a>&nbsp;class.<br>
&nbsp;<br>
This&nbsp;implementation&nbsp;tries&nbsp;to&nbsp;be&nbsp;as&nbsp;completely&nbsp;cormforming&nbsp;to&nbsp;all<br>
intricacies&nbsp;of&nbsp;the&nbsp;standards&nbsp;as&nbsp;possible.&nbsp;&nbsp;It&nbsp;can&nbsp;operate&nbsp;in&nbsp;strict<br>
mode&nbsp;(which&nbsp;only&nbsp;allows&nbsp;<a href="#JSON">JSON</a>-compliant&nbsp;syntax)&nbsp;or&nbsp;a&nbsp;non-strict&nbsp;mode<br>
(which&nbsp;allows&nbsp;much&nbsp;more&nbsp;of&nbsp;the&nbsp;whole&nbsp;ECMAScript&nbsp;permitted&nbsp;syntax).<br>
This&nbsp;includes&nbsp;complete&nbsp;support&nbsp;for&nbsp;Unicode&nbsp;strings&nbsp;(including<br>
surrogate-pairs&nbsp;for&nbsp;non-BMP&nbsp;characters),&nbsp;and&nbsp;all&nbsp;number&nbsp;formats<br>
including&nbsp;negative&nbsp;zero&nbsp;and&nbsp;IEEE&nbsp;754&nbsp;non-numbers&nbsp;such&nbsp;a&nbsp;NaN&nbsp;or<br>
Infinity.<br>
&nbsp;<br>
The&nbsp;<a href="#JSON">JSON</a>/ECMAScript&nbsp;to&nbsp;Python&nbsp;type&nbsp;mappings&nbsp;are:<br>
&nbsp;&nbsp;&nbsp;---<a href="#JSON">JSON</a>---&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;---Python---<br>
&nbsp;&nbsp;&nbsp;null&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;None<br>
&nbsp;&nbsp;&nbsp;undefined&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;undefined&nbsp;&nbsp;(note&nbsp;1)<br>
&nbsp;&nbsp;&nbsp;Boolean&nbsp;(true,false)&nbsp;&nbsp;&nbsp;bool&nbsp;&nbsp;(True&nbsp;or&nbsp;False)<br>
&nbsp;&nbsp;&nbsp;Integer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;or&nbsp;long&nbsp;&nbsp;(note&nbsp;2)<br>
&nbsp;&nbsp;&nbsp;Float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float<br>
&nbsp;&nbsp;&nbsp;String&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;or&nbsp;unicode&nbsp;&nbsp;(&nbsp;"..."&nbsp;or&nbsp;u"..."&nbsp;)<br>
&nbsp;&nbsp;&nbsp;Array&nbsp;[a,&nbsp;...]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list&nbsp;&nbsp;(&nbsp;[...]&nbsp;)<br>
&nbsp;&nbsp;&nbsp;Object&nbsp;{a:b,&nbsp;...}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dict&nbsp;&nbsp;(&nbsp;{...}&nbsp;)<br>
&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;--&nbsp;Note&nbsp;1.&nbsp;an&nbsp;'undefined'&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;is&nbsp;declared&nbsp;in&nbsp;this&nbsp;module&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;represents&nbsp;the&nbsp;native&nbsp;Python&nbsp;value&nbsp;for&nbsp;this&nbsp;type&nbsp;when&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-strict&nbsp;mode.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;--&nbsp;Note&nbsp;2.&nbsp;some&nbsp;ECMAScript&nbsp;integers&nbsp;may&nbsp;be&nbsp;up-converted&nbsp;to&nbsp;Python<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;floats,&nbsp;such&nbsp;as&nbsp;1e+40.&nbsp;&nbsp;Also&nbsp;integer&nbsp;-0&nbsp;is&nbsp;converted&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;-0,&nbsp;so&nbsp;as&nbsp;to&nbsp;preserve&nbsp;the&nbsp;sign&nbsp;(which&nbsp;ECMAScript&nbsp;requires).<br>
&nbsp;<br>
In&nbsp;addition,&nbsp;when&nbsp;operating&nbsp;in&nbsp;non-strict&nbsp;mode,&nbsp;several&nbsp;IEEE&nbsp;754<br>
non-numbers&nbsp;are&nbsp;also&nbsp;handled,&nbsp;and&nbsp;are&nbsp;mapped&nbsp;to&nbsp;specific&nbsp;Python<br>
objects&nbsp;declared&nbsp;in&nbsp;this&nbsp;module:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;NaN&nbsp;(not&nbsp;a&nbsp;number)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nan&nbsp;&nbsp;&nbsp;&nbsp;(float('nan'))<br>
&nbsp;&nbsp;&nbsp;&nbsp;Infinity,&nbsp;+Infinity&nbsp;&nbsp;&nbsp;&nbsp;inf&nbsp;&nbsp;&nbsp;&nbsp;(float('inf'))<br>
&nbsp;&nbsp;&nbsp;&nbsp;-Infinity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;neginf&nbsp;(float('-inf'))<br>
&nbsp;<br>
When&nbsp;encoding&nbsp;Python&nbsp;objects&nbsp;into&nbsp;<a href="#JSON">JSON</a>,&nbsp;you&nbsp;may&nbsp;use&nbsp;types&nbsp;other&nbsp;than<br>
native&nbsp;lists&nbsp;or&nbsp;dictionaries,&nbsp;as&nbsp;long&nbsp;as&nbsp;they&nbsp;support&nbsp;the&nbsp;minimal<br>
interfaces&nbsp;required&nbsp;of&nbsp;all&nbsp;sequences&nbsp;or&nbsp;mappings.&nbsp;&nbsp;This&nbsp;means&nbsp;you&nbsp;can<br>
use&nbsp;generators&nbsp;and&nbsp;iterators,&nbsp;tuples,&nbsp;UserDict&nbsp;subclasses,&nbsp;etc.<br>
&nbsp;<br>
To&nbsp;make&nbsp;it&nbsp;easier&nbsp;to&nbsp;produce&nbsp;<a href="#JSON">JSON</a>&nbsp;encoded&nbsp;representations&nbsp;of&nbsp;user<br>
defined&nbsp;classes,&nbsp;if&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;has&nbsp;a&nbsp;method&nbsp;named&nbsp;json_equivalent(),<br>
then&nbsp;it&nbsp;will&nbsp;call&nbsp;that&nbsp;method&nbsp;and&nbsp;attempt&nbsp;to&nbsp;encode&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a><br>
returned&nbsp;from&nbsp;it&nbsp;instead.&nbsp;&nbsp;It&nbsp;will&nbsp;do&nbsp;this&nbsp;recursively&nbsp;as&nbsp;needed&nbsp;and<br>
before&nbsp;any&nbsp;attempt&nbsp;to&nbsp;encode&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;using&nbsp;it's&nbsp;default<br>
strategies.&nbsp;&nbsp;Note&nbsp;that&nbsp;any&nbsp;json_equivalent()&nbsp;method&nbsp;should&nbsp;return<br>
"equivalent"&nbsp;Python&nbsp;objects&nbsp;to&nbsp;be&nbsp;encoded,&nbsp;not&nbsp;an&nbsp;already-encoded<br>
<a href="#JSON">JSON</a>-formatted&nbsp;string.&nbsp;&nbsp;There&nbsp;is&nbsp;no&nbsp;such&nbsp;aid&nbsp;provided&nbsp;to&nbsp;decode<br>
<a href="#JSON">JSON</a>&nbsp;back&nbsp;into&nbsp;user-defined&nbsp;classes&nbsp;as&nbsp;that&nbsp;would&nbsp;dramatically<br>
complicate&nbsp;the&nbsp;interface.<br>
&nbsp;<br>
When&nbsp;decoding&nbsp;strings&nbsp;with&nbsp;this&nbsp;module&nbsp;it&nbsp;may&nbsp;operate&nbsp;in&nbsp;either<br>
strict&nbsp;or&nbsp;non-strict&nbsp;mode.&nbsp;&nbsp;The&nbsp;strict&nbsp;mode&nbsp;only&nbsp;allows&nbsp;syntax&nbsp;which<br>
is&nbsp;conforming&nbsp;to&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc4627.txt">RFC&nbsp;4627</a>&nbsp;(<a href="#JSON">JSON</a>),&nbsp;while&nbsp;the&nbsp;non-strict&nbsp;allows&nbsp;much<br>
more&nbsp;of&nbsp;the&nbsp;permissible&nbsp;ECMAScript&nbsp;syntax.<br>
&nbsp;<br>
The&nbsp;following&nbsp;are&nbsp;permitted&nbsp;when&nbsp;processing&nbsp;in&nbsp;NON-STRICT&nbsp;mode:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;*&nbsp;Unicode&nbsp;format&nbsp;control&nbsp;characters&nbsp;are&nbsp;allowed&nbsp;anywhere&nbsp;in&nbsp;the&nbsp;input.<br>
&nbsp;&nbsp;&nbsp;*&nbsp;All&nbsp;Unicode&nbsp;line&nbsp;terminator&nbsp;characters&nbsp;are&nbsp;recognized.<br>
&nbsp;&nbsp;&nbsp;*&nbsp;All&nbsp;Unicode&nbsp;white&nbsp;space&nbsp;characters&nbsp;are&nbsp;recognized.<br>
&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;'undefined'&nbsp;keyword&nbsp;is&nbsp;recognized.<br>
&nbsp;&nbsp;&nbsp;*&nbsp;Hexadecimal&nbsp;number&nbsp;literals&nbsp;are&nbsp;recognized&nbsp;(e.g.,&nbsp;0xA6,&nbsp;0177).<br>
&nbsp;&nbsp;&nbsp;*&nbsp;String&nbsp;literals&nbsp;may&nbsp;use&nbsp;either&nbsp;single&nbsp;or&nbsp;double&nbsp;quote&nbsp;marks.<br>
&nbsp;&nbsp;&nbsp;*&nbsp;Strings&nbsp;may&nbsp;contain&nbsp;\x&nbsp;(hexadecimal)&nbsp;escape&nbsp;sequences,&nbsp;as&nbsp;well&nbsp;as&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\v&nbsp;and&nbsp;\0&nbsp;escape&nbsp;sequences.<br>
&nbsp;&nbsp;&nbsp;*&nbsp;Lists&nbsp;may&nbsp;have&nbsp;omitted&nbsp;(elided)&nbsp;elements,&nbsp;e.g.,&nbsp;[,,,,,],&nbsp;with<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;missing&nbsp;elements&nbsp;interpreted&nbsp;as&nbsp;'undefined'&nbsp;values.<br>
&nbsp;&nbsp;&nbsp;*&nbsp;Object&nbsp;properties&nbsp;(dictionary&nbsp;keys)&nbsp;can&nbsp;be&nbsp;of&nbsp;any&nbsp;of&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;types:&nbsp;string&nbsp;literals,&nbsp;numbers,&nbsp;or&nbsp;identifiers&nbsp;(the&nbsp;later&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;are&nbsp;treated&nbsp;as&nbsp;if&nbsp;they&nbsp;are&nbsp;string&nbsp;literals)---as&nbsp;permitted<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;by&nbsp;ECMAScript.&nbsp;&nbsp;<a href="#JSON">JSON</a>&nbsp;only&nbsp;permits&nbsp;strings&nbsp;literals&nbsp;as&nbsp;keys.<br>
&nbsp;<br>
Concerning&nbsp;non-strict&nbsp;and&nbsp;non-ECMAScript&nbsp;allowances:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;*&nbsp;Octal&nbsp;numbers:&nbsp;If&nbsp;you&nbsp;allow&nbsp;the&nbsp;'octal_numbers'&nbsp;behavior&nbsp;(which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;never&nbsp;enabled&nbsp;by&nbsp;default),&nbsp;then&nbsp;you&nbsp;can&nbsp;use&nbsp;octal&nbsp;integers<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;octal&nbsp;character&nbsp;escape&nbsp;sequences&nbsp;(per&nbsp;the&nbsp;ECMAScript<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;standard&nbsp;Annex&nbsp;B.1.2).&nbsp;&nbsp;This&nbsp;behavior&nbsp;is&nbsp;allowed,&nbsp;if&nbsp;enabled,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;because&nbsp;it&nbsp;was&nbsp;valid&nbsp;JavaScript&nbsp;at&nbsp;one&nbsp;time.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;*&nbsp;Multi-line&nbsp;string&nbsp;literals:&nbsp;&nbsp;Strings&nbsp;which&nbsp;are&nbsp;more&nbsp;than&nbsp;one<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line&nbsp;long&nbsp;(contain&nbsp;embedded&nbsp;raw&nbsp;newline&nbsp;characters)&nbsp;are&nbsp;never<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permitted.&nbsp;This&nbsp;is&nbsp;neither&nbsp;valid&nbsp;<a href="#JSON">JSON</a>&nbsp;nor&nbsp;ECMAScript.&nbsp;&nbsp;Some&nbsp;other<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#JSON">JSON</a>&nbsp;implementations&nbsp;may&nbsp;allow&nbsp;this,&nbsp;but&nbsp;this&nbsp;module&nbsp;considers<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;behavior&nbsp;to&nbsp;be&nbsp;a&nbsp;mistake.<br>
&nbsp;<br>
References:<br>
&nbsp;&nbsp;&nbsp;*&nbsp;<a href="#JSON">JSON</a>&nbsp;(JavaScript&nbsp;Object&nbsp;Notation)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://json.org/">http://json.org/</a>&gt;<br>
&nbsp;&nbsp;&nbsp;*&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc4627.txt">RFC&nbsp;4627</a>.&nbsp;The&nbsp;application/json&nbsp;Media&nbsp;Type&nbsp;for&nbsp;JavaScript&nbsp;Object&nbsp;Notation&nbsp;(<a href="#JSON">JSON</a>)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://www.ietf.org/rfc/rfc4627.txt">http://www.ietf.org/rfc/rfc4627.txt</a>&gt;<br>
&nbsp;&nbsp;&nbsp;*&nbsp;ECMA-262&nbsp;3rd&nbsp;edition&nbsp;(1999)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf">http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf</a>&gt;<br>
&nbsp;&nbsp;&nbsp;*&nbsp;IEEE&nbsp;754-1985:&nbsp;Standard&nbsp;for&nbsp;Binary&nbsp;Floating-Point&nbsp;Arithmetic.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://www.cs.berkeley.edu/~ejr/Projects/ieee754/">http://www.cs.berkeley.edu/~ejr/Projects/ieee754/</a>&gt;</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="exceptions.html#ValueError">exceptions.ValueError</a>(<a href="exceptions.html#StandardError">exceptions.StandardError</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="demjson.html#JSONError">JSONError</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="demjson.html#JSONDecodeError">JSONDecodeError</a>
</font></dt><dt><font face="helvetica, arial"><a href="demjson.html#JSONEncodeError">JSONEncodeError</a>
</font></dt></dl>
</dd>
</dl>
</dd>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="demjson.html#JSON">JSON</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="JSON">class <strong>JSON</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>An&nbsp;encoder/decoder&nbsp;for&nbsp;<a href="#JSON">JSON</a>&nbsp;data&nbsp;streams.<br>
&nbsp;<br>
Usually&nbsp;you&nbsp;will&nbsp;call&nbsp;the&nbsp;<a href="#JSON-encode">encode</a>()&nbsp;or&nbsp;<a href="#JSON-decode">decode</a>()&nbsp;methods.&nbsp;&nbsp;The&nbsp;other<br>
methods&nbsp;are&nbsp;for&nbsp;lower-level&nbsp;processing.<br>
&nbsp;<br>
Whether&nbsp;the&nbsp;<a href="#JSON">JSON</a>&nbsp;parser&nbsp;runs&nbsp;in&nbsp;strict&nbsp;mode&nbsp;(which&nbsp;enforces&nbsp;exact<br>
compliance&nbsp;with&nbsp;the&nbsp;<a href="#JSON">JSON</a>&nbsp;spec)&nbsp;or&nbsp;the&nbsp;more&nbsp;forgiving&nbsp;non-string&nbsp;mode<br>
can&nbsp;be&nbsp;affected&nbsp;by&nbsp;setting&nbsp;the&nbsp;'strict'&nbsp;argument&nbsp;in&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>'s<br>
initialization;&nbsp;or&nbsp;by&nbsp;assigning&nbsp;True&nbsp;or&nbsp;False&nbsp;to&nbsp;the&nbsp;'strict'<br>
property&nbsp;of&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
You&nbsp;can&nbsp;also&nbsp;adjust&nbsp;a&nbsp;finer-grained&nbsp;control&nbsp;over&nbsp;strictness&nbsp;by<br>
allowing&nbsp;or&nbsp;preventing&nbsp;specific&nbsp;behaviors.&nbsp;&nbsp;You&nbsp;can&nbsp;get&nbsp;a&nbsp;list&nbsp;of<br>
all&nbsp;the&nbsp;available&nbsp;behaviors&nbsp;by&nbsp;accessing&nbsp;the&nbsp;'behaviors'&nbsp;property.<br>
Likewise&nbsp;the&nbsp;allowed_behaviors&nbsp;and&nbsp;prevented_behaviors&nbsp;list&nbsp;which<br>
behaviors&nbsp;will&nbsp;be&nbsp;allowed&nbsp;and&nbsp;which&nbsp;will&nbsp;not.&nbsp;&nbsp;Call&nbsp;the&nbsp;<a href="#JSON-allow">allow</a>()<br>
or&nbsp;<a href="#JSON-prevent">prevent</a>()&nbsp;methods&nbsp;to&nbsp;adjust&nbsp;these.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="JSON-__init__"><strong>__init__</strong></a>(self, strict<font color="#909090">=False</font>, compactly<font color="#909090">=True</font>, escape_unicode<font color="#909090">=False</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;<a href="#JSON">JSON</a>&nbsp;encoder/decoder&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
If&nbsp;'strict'&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;then&nbsp;only&nbsp;strictly-conforming&nbsp;<a href="#JSON">JSON</a><br>
output&nbsp;will&nbsp;be&nbsp;produced.&nbsp;&nbsp;Note&nbsp;that&nbsp;this&nbsp;means&nbsp;that&nbsp;some&nbsp;types<br>
of&nbsp;values&nbsp;may&nbsp;not&nbsp;be&nbsp;convertable&nbsp;and&nbsp;will&nbsp;result&nbsp;in&nbsp;a<br>
<a href="#JSONEncodeError">JSONEncodeError</a>&nbsp;exception.<br>
&nbsp;<br>
If&nbsp;'compactly'&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;then&nbsp;the&nbsp;resulting&nbsp;string&nbsp;will<br>
have&nbsp;all&nbsp;extraneous&nbsp;white&nbsp;space&nbsp;removed;&nbsp;if&nbsp;False&nbsp;then&nbsp;the<br>
string&nbsp;will&nbsp;be&nbsp;"pretty&nbsp;printed"&nbsp;with&nbsp;whitespace&nbsp;and&nbsp;indentation<br>
added&nbsp;to&nbsp;make&nbsp;it&nbsp;more&nbsp;readable.<br>
&nbsp;<br>
If&nbsp;'escape_unicode'&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;then&nbsp;all&nbsp;non-ASCII&nbsp;characters<br>
will&nbsp;be&nbsp;represented&nbsp;as&nbsp;a&nbsp;unicode&nbsp;escape&nbsp;sequence;&nbsp;if&nbsp;False&nbsp;then<br>
the&nbsp;actual&nbsp;real&nbsp;unicode&nbsp;character&nbsp;will&nbsp;be&nbsp;inserted&nbsp;if&nbsp;possible.<br>
&nbsp;<br>
The&nbsp;'escape_unicode'&nbsp;can&nbsp;also&nbsp;be&nbsp;a&nbsp;function,&nbsp;which&nbsp;when&nbsp;called<br>
with&nbsp;a&nbsp;single&nbsp;argument&nbsp;of&nbsp;a&nbsp;unicode&nbsp;character&nbsp;will&nbsp;return&nbsp;True<br>
if&nbsp;the&nbsp;character&nbsp;should&nbsp;be&nbsp;escaped&nbsp;or&nbsp;False&nbsp;if&nbsp;it&nbsp;should&nbsp;not.<br>
&nbsp;<br>
If&nbsp;you&nbsp;wish&nbsp;to&nbsp;extend&nbsp;the&nbsp;encoding&nbsp;to&nbsp;ba&nbsp;able&nbsp;to&nbsp;handle<br>
additional&nbsp;types,&nbsp;you&nbsp;should&nbsp;subclass&nbsp;this&nbsp;class&nbsp;and&nbsp;override<br>
the&nbsp;<a href="#JSON-encode_default">encode_default</a>()&nbsp;method.</tt></dd></dl>

<dl><dt><a name="JSON-allow"><strong>allow</strong></a>(self, behavior)</dt><dd><tt>Allow&nbsp;the&nbsp;specified&nbsp;behavior&nbsp;(turn&nbsp;off&nbsp;a&nbsp;strictness&nbsp;check).<br>
&nbsp;<br>
The&nbsp;list&nbsp;of&nbsp;all&nbsp;possible&nbsp;behaviors&nbsp;is&nbsp;available&nbsp;in&nbsp;the&nbsp;behaviors&nbsp;property.<br>
You&nbsp;can&nbsp;see&nbsp;which&nbsp;behaviors&nbsp;are&nbsp;currently&nbsp;allowed&nbsp;by&nbsp;accessing&nbsp;the<br>
allowed_behaviors&nbsp;property.</tt></dd></dl>

<dl><dt><a name="JSON-decode"><strong>decode</strong></a>(self, txt)</dt><dd><tt>Decodes&nbsp;a&nbsp;<a href="#JSON">JSON</a>-endoded&nbsp;string&nbsp;into&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.</tt></dd></dl>

<dl><dt><a name="JSON-decode_boolean"><strong>decode_boolean</strong></a>(self, s, i<font color="#909090">=0</font>)</dt><dd><tt>Intermediate-level&nbsp;decode&nbsp;for&nbsp;<a href="#JSON">JSON</a>&nbsp;boolean&nbsp;literals.<br>
&nbsp;<br>
Takes&nbsp;a&nbsp;string&nbsp;and&nbsp;a&nbsp;starting&nbsp;index,&nbsp;and&nbsp;returns&nbsp;a&nbsp;Python&nbsp;bool<br>
(True&nbsp;or&nbsp;False)&nbsp;and&nbsp;the&nbsp;index&nbsp;of&nbsp;the&nbsp;next&nbsp;unparsed&nbsp;character.</tt></dd></dl>

<dl><dt><a name="JSON-decode_composite"><strong>decode_composite</strong></a>(self, txt, i<font color="#909090">=0</font>, imax<font color="#909090">=None</font>)</dt><dd><tt>Intermediate-level&nbsp;<a href="#JSON">JSON</a>&nbsp;decoder&nbsp;for&nbsp;composite&nbsp;literal&nbsp;types&nbsp;(array&nbsp;and&nbsp;<a href="__builtin__.html#object">object</a>).<br>
&nbsp;<br>
Takes&nbsp;text&nbsp;and&nbsp;a&nbsp;starting&nbsp;index,&nbsp;and&nbsp;returns&nbsp;either&nbsp;a&nbsp;Python&nbsp;list&nbsp;or<br>
dictionary&nbsp;and&nbsp;the&nbsp;index&nbsp;of&nbsp;the&nbsp;next&nbsp;unparsed&nbsp;character.</tt></dd></dl>

<dl><dt><a name="JSON-decode_javascript_identifier"><strong>decode_javascript_identifier</strong></a>(self, name)</dt><dd><tt>Convert&nbsp;a&nbsp;JavaScript&nbsp;identifier&nbsp;into&nbsp;a&nbsp;Python&nbsp;string&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
This&nbsp;method&nbsp;can&nbsp;be&nbsp;overriden&nbsp;by&nbsp;a&nbsp;subclass&nbsp;to&nbsp;redefine&nbsp;how&nbsp;JavaScript<br>
identifiers&nbsp;are&nbsp;turned&nbsp;into&nbsp;Python&nbsp;objects.&nbsp;&nbsp;By&nbsp;default&nbsp;this&nbsp;just<br>
converts&nbsp;them&nbsp;into&nbsp;strings.</tt></dd></dl>

<dl><dt><a name="JSON-decode_null"><strong>decode_null</strong></a>(self, s, i<font color="#909090">=0</font>)</dt><dd><tt>Intermediate-level&nbsp;decoder&nbsp;for&nbsp;ECMAScript&nbsp;'null'&nbsp;keyword.<br>
&nbsp;<br>
Takes&nbsp;a&nbsp;string&nbsp;and&nbsp;a&nbsp;starting&nbsp;index,&nbsp;and&nbsp;returns&nbsp;a&nbsp;Python<br>
None&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;and&nbsp;the&nbsp;index&nbsp;of&nbsp;the&nbsp;next&nbsp;unparsed&nbsp;character.</tt></dd></dl>

<dl><dt><a name="JSON-decode_number"><strong>decode_number</strong></a>(self, s, i<font color="#909090">=0</font>, imax<font color="#909090">=None</font>)</dt><dd><tt>Intermediate-level&nbsp;decoder&nbsp;for&nbsp;<a href="#JSON">JSON</a>&nbsp;numeric&nbsp;literals.<br>
&nbsp;<br>
Takes&nbsp;a&nbsp;string&nbsp;and&nbsp;a&nbsp;starting&nbsp;index,&nbsp;and&nbsp;returns&nbsp;a&nbsp;Python<br>
suitable&nbsp;numeric&nbsp;type&nbsp;and&nbsp;the&nbsp;index&nbsp;of&nbsp;the&nbsp;next&nbsp;unparsed&nbsp;character.<br>
&nbsp;<br>
The&nbsp;returned&nbsp;numeric&nbsp;type&nbsp;can&nbsp;be&nbsp;either&nbsp;of&nbsp;a&nbsp;Python&nbsp;int,<br>
long,&nbsp;or&nbsp;float.&nbsp;&nbsp;In&nbsp;addition&nbsp;some&nbsp;special&nbsp;non-numbers&nbsp;may<br>
also&nbsp;be&nbsp;returned&nbsp;such&nbsp;as&nbsp;nan,&nbsp;inf,&nbsp;and&nbsp;neginf&nbsp;(technically<br>
which&nbsp;are&nbsp;Python&nbsp;floats,&nbsp;but&nbsp;have&nbsp;no&nbsp;numeric&nbsp;value.)<br>
&nbsp;<br>
Ref.&nbsp;ECMAScript&nbsp;section&nbsp;8.5.</tt></dd></dl>

<dl><dt><a name="JSON-decode_string"><strong>decode_string</strong></a>(self, s, i<font color="#909090">=0</font>, imax<font color="#909090">=None</font>)</dt><dd><tt>Intermediate-level&nbsp;decoder&nbsp;for&nbsp;<a href="#JSON">JSON</a>&nbsp;string&nbsp;literals.<br>
&nbsp;<br>
Takes&nbsp;a&nbsp;string&nbsp;and&nbsp;a&nbsp;starting&nbsp;index,&nbsp;and&nbsp;returns&nbsp;a&nbsp;Python<br>
string&nbsp;(or&nbsp;unicode&nbsp;string)&nbsp;and&nbsp;the&nbsp;index&nbsp;of&nbsp;the&nbsp;next&nbsp;unparsed<br>
character.</tt></dd></dl>

<dl><dt><a name="JSON-decodeobj"><strong>decodeobj</strong></a>(self, txt, i<font color="#909090">=0</font>, imax<font color="#909090">=None</font>, identifier_as_string<font color="#909090">=False</font>, only_object_or_array<font color="#909090">=False</font>)</dt><dd><tt>Intermediate-level&nbsp;<a href="#JSON">JSON</a>&nbsp;decoder.<br>
&nbsp;<br>
Takes&nbsp;a&nbsp;string&nbsp;and&nbsp;a&nbsp;starting&nbsp;index,&nbsp;and&nbsp;returns&nbsp;a&nbsp;two-tuple&nbsp;consting<br>
of&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;and&nbsp;the&nbsp;index&nbsp;of&nbsp;the&nbsp;next&nbsp;unparsed&nbsp;character.<br>
&nbsp;<br>
If&nbsp;there&nbsp;is&nbsp;no&nbsp;value&nbsp;at&nbsp;all&nbsp;(empty&nbsp;string,&nbsp;etc),&nbsp;the&nbsp;None&nbsp;is<br>
returned&nbsp;instead&nbsp;of&nbsp;a&nbsp;tuple.</tt></dd></dl>

<dl><dt><a name="JSON-encode"><strong>encode</strong></a>(self, obj, nest_level<font color="#909090">=0</font>)</dt><dd><tt>Encodes&nbsp;the&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;into&nbsp;a&nbsp;<a href="#JSON">JSON</a>&nbsp;string&nbsp;representation.<br>
&nbsp;<br>
This&nbsp;method&nbsp;will&nbsp;first&nbsp;attempt&nbsp;to&nbsp;encode&nbsp;an&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;by&nbsp;seeing<br>
if&nbsp;it&nbsp;has&nbsp;a&nbsp;json_equivalent()&nbsp;method.&nbsp;&nbsp;If&nbsp;so&nbsp;than&nbsp;it&nbsp;will<br>
call&nbsp;that&nbsp;method&nbsp;and&nbsp;then&nbsp;recursively&nbsp;attempt&nbsp;to&nbsp;encode<br>
the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;resulting&nbsp;from&nbsp;that&nbsp;call.<br>
&nbsp;<br>
Next&nbsp;it&nbsp;will&nbsp;attempt&nbsp;to&nbsp;determine&nbsp;if&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;is&nbsp;a&nbsp;native<br>
type&nbsp;or&nbsp;acts&nbsp;like&nbsp;a&nbsp;squence&nbsp;or&nbsp;dictionary.&nbsp;&nbsp;If&nbsp;so&nbsp;it&nbsp;will<br>
encode&nbsp;that&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;directly.<br>
&nbsp;<br>
Finally,&nbsp;if&nbsp;no&nbsp;other&nbsp;strategy&nbsp;for&nbsp;encoding&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;of&nbsp;that<br>
type&nbsp;exists,&nbsp;it&nbsp;will&nbsp;call&nbsp;the&nbsp;<a href="#JSON-encode_default">encode_default</a>()&nbsp;method.&nbsp;&nbsp;That<br>
method&nbsp;currently&nbsp;raises&nbsp;an&nbsp;error,&nbsp;but&nbsp;it&nbsp;could&nbsp;be&nbsp;overridden<br>
by&nbsp;subclasses&nbsp;to&nbsp;provide&nbsp;a&nbsp;hook&nbsp;for&nbsp;extending&nbsp;the&nbsp;types&nbsp;which<br>
can&nbsp;be&nbsp;encoded.</tt></dd></dl>

<dl><dt><a name="JSON-encode_boolean"><strong>encode_boolean</strong></a>(self, b)</dt><dd><tt>Encodes&nbsp;the&nbsp;Python&nbsp;boolean&nbsp;into&nbsp;a&nbsp;<a href="#JSON">JSON</a>&nbsp;Boolean&nbsp;literal.</tt></dd></dl>

<dl><dt><a name="JSON-encode_composite"><strong>encode_composite</strong></a>(self, chunklist, obj, nest_level)</dt><dd><tt>Encodes&nbsp;just&nbsp;dictionaries,&nbsp;lists,&nbsp;or&nbsp;sequences.<br>
&nbsp;<br>
Basically&nbsp;handles&nbsp;any&nbsp;python&nbsp;type&nbsp;for&nbsp;which&nbsp;iter()&nbsp;can&nbsp;create<br>
an&nbsp;iterator&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
This&nbsp;method&nbsp;is&nbsp;not&nbsp;intended&nbsp;to&nbsp;be&nbsp;called&nbsp;directly.&nbsp;&nbsp;Use&nbsp;the<br>
<a href="#JSON-encode">encode</a>()&nbsp;method&nbsp;instead.</tt></dd></dl>

<dl><dt><a name="JSON-encode_default"><strong>encode_default</strong></a>(self, obj, nest_level<font color="#909090">=0</font>)</dt><dd><tt>This&nbsp;method&nbsp;is&nbsp;used&nbsp;to&nbsp;encode&nbsp;objects&nbsp;into&nbsp;<a href="#JSON">JSON</a>&nbsp;which&nbsp;are&nbsp;not&nbsp;straightforward.<br>
&nbsp;<br>
This&nbsp;method&nbsp;is&nbsp;intended&nbsp;to&nbsp;be&nbsp;overridden&nbsp;by&nbsp;subclasses&nbsp;which&nbsp;wish<br>
to&nbsp;extend&nbsp;this&nbsp;encoder&nbsp;to&nbsp;handle&nbsp;additional&nbsp;types.</tt></dd></dl>

<dl><dt><a name="JSON-encode_equivalent"><strong>encode_equivalent</strong></a>(self, obj, nest_level<font color="#909090">=0</font>)</dt><dd><tt>This&nbsp;method&nbsp;is&nbsp;used&nbsp;to&nbsp;encode&nbsp;user-defined&nbsp;class&nbsp;objects.<br>
&nbsp;<br>
The&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;being&nbsp;encoded&nbsp;should&nbsp;have&nbsp;a&nbsp;json_equivalent()<br>
method&nbsp;defined&nbsp;which&nbsp;returns&nbsp;another&nbsp;equivalent&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which<br>
is&nbsp;easily&nbsp;<a href="#JSON">JSON</a>-encoded.&nbsp;&nbsp;If&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;in&nbsp;question&nbsp;has&nbsp;no<br>
json_equivalent()&nbsp;method&nbsp;available&nbsp;then&nbsp;None&nbsp;is&nbsp;returned<br>
instead&nbsp;of&nbsp;a&nbsp;string&nbsp;so&nbsp;that&nbsp;the&nbsp;encoding&nbsp;will&nbsp;attempt&nbsp;the&nbsp;next<br>
strategy.<br>
&nbsp;<br>
If&nbsp;a&nbsp;caller&nbsp;wishes&nbsp;to&nbsp;disable&nbsp;the&nbsp;calling&nbsp;of&nbsp;json_equivalent()<br>
methods,&nbsp;then&nbsp;subclass&nbsp;this&nbsp;class&nbsp;and&nbsp;override&nbsp;this&nbsp;method<br>
to&nbsp;just&nbsp;return&nbsp;None.</tt></dd></dl>

<dl><dt><a name="JSON-encode_helper"><strong>encode_helper</strong></a>(self, chunklist, obj, nest_level)</dt></dl>

<dl><dt><a name="JSON-encode_null"><strong>encode_null</strong></a>(self)</dt><dd><tt>Produces&nbsp;the&nbsp;<a href="#JSON">JSON</a>&nbsp;'null'&nbsp;keyword.</tt></dd></dl>

<dl><dt><a name="JSON-encode_number"><strong>encode_number</strong></a>(self, n)</dt><dd><tt>Encodes&nbsp;a&nbsp;Python&nbsp;numeric&nbsp;type&nbsp;into&nbsp;a&nbsp;<a href="#JSON">JSON</a>&nbsp;numeric&nbsp;literal.<br>
&nbsp;<br>
The&nbsp;special&nbsp;non-numeric&nbsp;values&nbsp;of&nbsp;float('nan'),&nbsp;float('inf')<br>
and&nbsp;float('-inf')&nbsp;are&nbsp;translated&nbsp;into&nbsp;appropriate&nbsp;<a href="#JSON">JSON</a><br>
literals.<br>
&nbsp;<br>
Note&nbsp;that&nbsp;Python&nbsp;complex&nbsp;types&nbsp;are&nbsp;not&nbsp;handled,&nbsp;as&nbsp;there&nbsp;is&nbsp;no<br>
ECMAScript&nbsp;equivalent&nbsp;type.</tt></dd></dl>

<dl><dt><a name="JSON-encode_string"><strong>encode_string</strong></a>(self, s)</dt><dd><tt>Encodes&nbsp;a&nbsp;Python&nbsp;string&nbsp;into&nbsp;a&nbsp;<a href="#JSON">JSON</a>&nbsp;string&nbsp;literal.</tt></dd></dl>

<dl><dt><a name="JSON-encode_undefined"><strong>encode_undefined</strong></a>(self)</dt><dd><tt>Produces&nbsp;the&nbsp;ECMAScript&nbsp;'undefined'&nbsp;keyword.</tt></dd></dl>

<dl><dt><a name="JSON-islineterm"><strong>islineterm</strong></a>(self, c)</dt><dd><tt>Determines&nbsp;if&nbsp;the&nbsp;given&nbsp;character&nbsp;is&nbsp;considered&nbsp;a&nbsp;line&nbsp;terminator.<br>
&nbsp;<br>
Ref.&nbsp;ECMAScript&nbsp;section&nbsp;7.3</tt></dd></dl>

<dl><dt><a name="JSON-isws"><strong>isws</strong></a>(self, c)</dt><dd><tt>Determines&nbsp;if&nbsp;the&nbsp;given&nbsp;character&nbsp;is&nbsp;considered&nbsp;as&nbsp;white&nbsp;space.<br>
&nbsp;<br>
Note&nbsp;that&nbsp;Javscript&nbsp;is&nbsp;much&nbsp;more&nbsp;permissive&nbsp;on&nbsp;what&nbsp;it&nbsp;considers<br>
to&nbsp;be&nbsp;whitespace&nbsp;than&nbsp;does&nbsp;<a href="#JSON">JSON</a>.<br>
&nbsp;<br>
Ref.&nbsp;ECMAScript&nbsp;section&nbsp;7.2</tt></dd></dl>

<dl><dt><a name="JSON-prevent"><strong>prevent</strong></a>(self, behavior)</dt><dd><tt>Prevent&nbsp;the&nbsp;specified&nbsp;behavior&nbsp;(turn&nbsp;on&nbsp;a&nbsp;strictness&nbsp;check).<br>
&nbsp;<br>
The&nbsp;list&nbsp;of&nbsp;all&nbsp;possible&nbsp;behaviors&nbsp;is&nbsp;available&nbsp;in&nbsp;the&nbsp;behaviors&nbsp;property.<br>
You&nbsp;can&nbsp;see&nbsp;which&nbsp;behaviors&nbsp;are&nbsp;currently&nbsp;prevented&nbsp;by&nbsp;accessing&nbsp;the<br>
prevented_behaviors&nbsp;property.</tt></dd></dl>

<dl><dt><a name="JSON-skip_comment"><strong>skip_comment</strong></a>(self, txt, i<font color="#909090">=0</font>)</dt><dd><tt>Skips&nbsp;an&nbsp;ECMAScript&nbsp;comment,&nbsp;either&nbsp;//&nbsp;or&nbsp;/*&nbsp;style.<br>
&nbsp;<br>
The&nbsp;contents&nbsp;of&nbsp;the&nbsp;comment&nbsp;are&nbsp;returned&nbsp;as&nbsp;a&nbsp;string,&nbsp;as&nbsp;well<br>
as&nbsp;the&nbsp;index&nbsp;of&nbsp;the&nbsp;character&nbsp;immediately&nbsp;after&nbsp;the&nbsp;comment.</tt></dd></dl>

<dl><dt><a name="JSON-skipws"><strong>skipws</strong></a>(self, txt, i<font color="#909090">=0</font>, imax<font color="#909090">=None</font>, skip_comments<font color="#909090">=True</font>)</dt><dd><tt>Skips&nbsp;whitespace.</tt></dd></dl>

<dl><dt><a name="JSON-skipws_any"><strong>skipws_any</strong></a>(self, txt, i<font color="#909090">=0</font>, imax<font color="#909090">=None</font>, skip_comments<font color="#909090">=True</font>)</dt><dd><tt>Skips&nbsp;all&nbsp;whitespace,&nbsp;including&nbsp;comments&nbsp;and&nbsp;unicode&nbsp;whitespace<br>
&nbsp;<br>
Takes&nbsp;a&nbsp;string&nbsp;and&nbsp;a&nbsp;starting&nbsp;index,&nbsp;and&nbsp;returns&nbsp;the&nbsp;index&nbsp;of&nbsp;the<br>
next&nbsp;non-whitespace&nbsp;character.<br>
&nbsp;<br>
If&nbsp;skip_comments&nbsp;is&nbsp;True&nbsp;and&nbsp;not&nbsp;running&nbsp;in&nbsp;strict&nbsp;<a href="#JSON">JSON</a>&nbsp;mode,&nbsp;then<br>
comments&nbsp;will&nbsp;be&nbsp;skipped&nbsp;over&nbsp;just&nbsp;like&nbsp;whitespace.</tt></dd></dl>

<dl><dt><a name="JSON-strip_format_control_chars"><strong>strip_format_control_chars</strong></a>(self, txt)</dt><dd><tt>Filters&nbsp;out&nbsp;all&nbsp;Unicode&nbsp;format&nbsp;control&nbsp;characters&nbsp;from&nbsp;the&nbsp;string.<br>
&nbsp;<br>
ECMAScript&nbsp;permits&nbsp;any&nbsp;Unicode&nbsp;"format&nbsp;control&nbsp;characters"&nbsp;to<br>
appear&nbsp;at&nbsp;any&nbsp;place&nbsp;in&nbsp;the&nbsp;source&nbsp;code.&nbsp;&nbsp;They&nbsp;are&nbsp;to&nbsp;be<br>
ignored&nbsp;as&nbsp;if&nbsp;they&nbsp;are&nbsp;not&nbsp;there&nbsp;before&nbsp;any&nbsp;other&nbsp;lexical<br>
tokenization&nbsp;occurs.&nbsp;&nbsp;Note&nbsp;that&nbsp;<a href="#JSON">JSON</a>&nbsp;does&nbsp;not&nbsp;allow&nbsp;them.<br>
&nbsp;<br>
Ref.&nbsp;ECMAScript&nbsp;section&nbsp;7.1.</tt></dd></dl>

<hr>
Properties defined here:<br>
<dl><dt><strong>allowed_behaviors</strong></dt>
<dd><tt>List&nbsp;of&nbsp;known&nbsp;behaviors&nbsp;that&nbsp;are&nbsp;currently&nbsp;allowed</tt></dd>
<dd><dl><dt><a name="JSON-<em>get</em>"><strong><em>get</em></strong></a> = <a href="#JSON-_get_allowed_behaviors">_get_allowed_behaviors</a>(self)</dt></dl>
</dd>
</dl>
<dl><dt><strong>behaviors</strong></dt>
<dd><tt>List&nbsp;of&nbsp;known&nbsp;behaviors&nbsp;that&nbsp;can&nbsp;be&nbsp;passed&nbsp;to&nbsp;<a href="#JSON-allow">allow</a>()&nbsp;or&nbsp;<a href="#JSON-prevent">prevent</a>()&nbsp;methods</tt></dd>
<dd><dl><dt><a name="JSON-<em>get</em>"><strong><em>get</em></strong></a> = <a href="#JSON-_get_behaviors">_get_behaviors</a>(self)</dt></dl>
</dd>
</dl>
<dl><dt><strong>prevented_behaviors</strong></dt>
<dd><tt>List&nbsp;of&nbsp;known&nbsp;behaviors&nbsp;that&nbsp;are&nbsp;currently&nbsp;prevented</tt></dd>
<dd><dl><dt><a name="JSON-<em>get</em>"><strong><em>get</em></strong></a> = <a href="#JSON-_get_prevented_behaviors">_get_prevented_behaviors</a>(self)</dt></dl>
</dd>
</dl>
<dl><dt><strong>strict</strong></dt>
<dd><tt>True&nbsp;if&nbsp;adherence&nbsp;to&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc4627.txt">RFC&nbsp;4627</a>&nbsp;syntax&nbsp;is&nbsp;strict,&nbsp;or&nbsp;False&nbsp;is&nbsp;more&nbsp;generous&nbsp;ECMAScript&nbsp;syntax&nbsp;is&nbsp;permitted</tt></dd>
<dd><dl><dt><a name="JSON-<em>get</em>"><strong><em>get</em></strong></a> = <a href="#JSON-_is_strict">_is_strict</a>(self)</dt></dl>
</dd>
<dd><dl><dt><a name="JSON-<em>set</em>"><strong><em>set</em></strong></a> = <a href="#JSON-_set_strictness">_set_strictness</a>(self, strict)</dt></dl>
</dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = &lt;dictproxy object&gt;<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dl>

<dl><dt><strong>__weakref__</strong> = &lt;attribute '__weakref__' of 'JSON' objects&gt;<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;(if&nbsp;defined)</tt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="JSONDecodeError">class <strong>JSONDecodeError</strong></a>(<a href="demjson.html#JSONError">JSONError</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>An&nbsp;exception&nbsp;class&nbsp;raised&nbsp;when&nbsp;a&nbsp;<a href="#JSON">JSON</a>&nbsp;decoding&nbsp;error&nbsp;(syntax&nbsp;error)&nbsp;occurs.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="demjson.html#JSONDecodeError">JSONDecodeError</a></dd>
<dd><a href="demjson.html#JSONError">JSONError</a></dd>
<dd><a href="exceptions.html#ValueError">exceptions.ValueError</a></dd>
<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
</dl>
<hr>
Methods inherited from <a href="demjson.html#JSONError">JSONError</a>:<br>
<dl><dt><a name="JSONDecodeError-pretty_description"><strong>pretty_description</strong></a>(self)</dt></dl>

<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="JSONDecodeError-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>

<dl><dt><a name="JSONDecodeError-__init__"><strong>__init__</strong></a>(...)</dt></dl>

<dl><dt><a name="JSONDecodeError-__str__"><strong>__str__</strong></a>(...)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="JSONEncodeError">class <strong>JSONEncodeError</strong></a>(<a href="demjson.html#JSONError">JSONError</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>An&nbsp;exception&nbsp;class&nbsp;raised&nbsp;when&nbsp;a&nbsp;python&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;can&nbsp;not&nbsp;be&nbsp;encoded&nbsp;as&nbsp;a&nbsp;<a href="#JSON">JSON</a>&nbsp;string.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="demjson.html#JSONEncodeError">JSONEncodeError</a></dd>
<dd><a href="demjson.html#JSONError">JSONError</a></dd>
<dd><a href="exceptions.html#ValueError">exceptions.ValueError</a></dd>
<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
</dl>
<hr>
Methods inherited from <a href="demjson.html#JSONError">JSONError</a>:<br>
<dl><dt><a name="JSONEncodeError-pretty_description"><strong>pretty_description</strong></a>(self)</dt></dl>

<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="JSONEncodeError-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>

<dl><dt><a name="JSONEncodeError-__init__"><strong>__init__</strong></a>(...)</dt></dl>

<dl><dt><a name="JSONEncodeError-__str__"><strong>__str__</strong></a>(...)</dt></dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="JSONError">class <strong>JSONError</strong></a>(<a href="exceptions.html#ValueError">exceptions.ValueError</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Our&nbsp;base&nbsp;class&nbsp;for&nbsp;all&nbsp;<a href="#JSON">JSON</a>-related&nbsp;errors.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="demjson.html#JSONError">JSONError</a></dd>
<dd><a href="exceptions.html#ValueError">exceptions.ValueError</a></dd>
<dd><a href="exceptions.html#StandardError">exceptions.StandardError</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="JSONError-pretty_description"><strong>pretty_description</strong></a>(self)</dt></dl>

<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="JSONError-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl>

<dl><dt><a name="JSONError-__init__"><strong>__init__</strong></a>(...)</dt></dl>

<dl><dt><a name="JSONError-__str__"><strong>__str__</strong></a>(...)</dt></dl>

</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-auto_unicode_decode"><strong>auto_unicode_decode</strong></a>(s)</dt><dd><tt>Takes&nbsp;a&nbsp;string&nbsp;and&nbsp;tries&nbsp;to&nbsp;convert&nbsp;it&nbsp;to&nbsp;a&nbsp;Unicode&nbsp;string.<br>
&nbsp;<br>
This&nbsp;will&nbsp;return&nbsp;a&nbsp;Python&nbsp;unicode&nbsp;string&nbsp;type&nbsp;corresponding&nbsp;to&nbsp;the<br>
input&nbsp;string&nbsp;(either&nbsp;str&nbsp;or&nbsp;unicode).&nbsp;&nbsp;The&nbsp;character&nbsp;encoding&nbsp;is<br>
guessed&nbsp;by&nbsp;looking&nbsp;for&nbsp;either&nbsp;a&nbsp;Unicode&nbsp;BOM&nbsp;prefix,&nbsp;or&nbsp;by&nbsp;the<br>
rules&nbsp;specified&nbsp;by&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc4627.txt">RFC&nbsp;4627</a>.&nbsp;&nbsp;When&nbsp;in&nbsp;doubt&nbsp;it&nbsp;is&nbsp;assumed&nbsp;the<br>
input&nbsp;is&nbsp;encoded&nbsp;in&nbsp;UTF-8&nbsp;(the&nbsp;default&nbsp;for&nbsp;<a href="#JSON">JSON</a>).</tt></dd></dl>
 <dl><dt><a name="-decode"><strong>decode</strong></a>(txt, strict<font color="#909090">=False</font>, encoding<font color="#909090">=None</font>, **kw)</dt><dd><tt>Decodes&nbsp;a&nbsp;<a href="#JSON">JSON</a>-encoded&nbsp;string&nbsp;into&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
If&nbsp;'strict'&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;then&nbsp;those&nbsp;strings&nbsp;that&nbsp;are&nbsp;not<br>
entirely&nbsp;strictly&nbsp;conforming&nbsp;to&nbsp;<a href="#JSON">JSON</a>&nbsp;will&nbsp;result&nbsp;in&nbsp;a<br>
<a href="#JSONDecodeError">JSONDecodeError</a>&nbsp;exception.<br>
&nbsp;<br>
The&nbsp;input&nbsp;string&nbsp;can&nbsp;be&nbsp;either&nbsp;a&nbsp;python&nbsp;string&nbsp;or&nbsp;a&nbsp;python&nbsp;unicode<br>
string.&nbsp;&nbsp;If&nbsp;it&nbsp;is&nbsp;already&nbsp;a&nbsp;unicode&nbsp;string,&nbsp;then&nbsp;it&nbsp;is&nbsp;assumed<br>
that&nbsp;no&nbsp;character&nbsp;set&nbsp;decoding&nbsp;is&nbsp;required.<br>
&nbsp;<br>
However,&nbsp;if&nbsp;you&nbsp;pass&nbsp;in&nbsp;a&nbsp;non-Unicode&nbsp;text&nbsp;string&nbsp;(i.e.,&nbsp;a&nbsp;python<br>
type&nbsp;'str')&nbsp;then&nbsp;an&nbsp;attempt&nbsp;will&nbsp;be&nbsp;made&nbsp;to&nbsp;auto-detect&nbsp;and&nbsp;decode<br>
the&nbsp;character&nbsp;encoding.&nbsp;&nbsp;This&nbsp;will&nbsp;be&nbsp;successful&nbsp;if&nbsp;the&nbsp;input&nbsp;was<br>
encoded&nbsp;in&nbsp;any&nbsp;of&nbsp;UTF-8,&nbsp;UTF-16&nbsp;(BE&nbsp;or&nbsp;LE),&nbsp;or&nbsp;UTF-32&nbsp;(BE&nbsp;or&nbsp;LE),<br>
and&nbsp;of&nbsp;course&nbsp;plain&nbsp;ASCII&nbsp;works&nbsp;too.<br>
&nbsp;<br>
Note&nbsp;though&nbsp;that&nbsp;if&nbsp;you&nbsp;know&nbsp;the&nbsp;character&nbsp;encoding,&nbsp;then&nbsp;you<br>
should&nbsp;convert&nbsp;to&nbsp;a&nbsp;unicode&nbsp;string&nbsp;yourself,&nbsp;or&nbsp;pass&nbsp;it&nbsp;the&nbsp;name<br>
of&nbsp;the&nbsp;'encoding'&nbsp;to&nbsp;avoid&nbsp;the&nbsp;guessing&nbsp;made&nbsp;by&nbsp;the&nbsp;auto<br>
detection,&nbsp;as&nbsp;with<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;python_object&nbsp;=&nbsp;demjson.<a href="#-decode">decode</a>(&nbsp;input_bytes,&nbsp;encoding='utf8'&nbsp;)<br>
&nbsp;<br>
Optional&nbsp;keywords&nbsp;arguments&nbsp;must&nbsp;be&nbsp;of&nbsp;the&nbsp;form<br>
&nbsp;&nbsp;&nbsp;&nbsp;allow_xxxx=True/False<br>
or<br>
&nbsp;&nbsp;&nbsp;&nbsp;prevent_xxxx=True/False<br>
where&nbsp;each&nbsp;will&nbsp;allow&nbsp;or&nbsp;prevent&nbsp;the&nbsp;specific&nbsp;behavior,&nbsp;after&nbsp;the<br>
evaluation&nbsp;of&nbsp;the&nbsp;'strict'&nbsp;argument.&nbsp;&nbsp;For&nbsp;example,&nbsp;if&nbsp;strict=True<br>
then&nbsp;by&nbsp;also&nbsp;passing&nbsp;'allow_comments=True'&nbsp;then&nbsp;comments&nbsp;will&nbsp;be<br>
allowed.&nbsp;&nbsp;If&nbsp;strict=False&nbsp;then&nbsp;prevent_comments=True&nbsp;will&nbsp;allow<br>
everything&nbsp;except&nbsp;comments.</tt></dd></dl>
 <dl><dt><a name="-decode_hex"><strong>decode_hex</strong></a>(hexstring)</dt><dd><tt>Decodes&nbsp;a&nbsp;hexadecimal&nbsp;string&nbsp;into&nbsp;it's&nbsp;integer&nbsp;value.</tt></dd></dl>
 <dl><dt><a name="-decode_octal"><strong>decode_octal</strong></a>(octalstring)</dt><dd><tt>Decodes&nbsp;an&nbsp;octal&nbsp;string&nbsp;into&nbsp;it's&nbsp;integer&nbsp;value.</tt></dd></dl>
 <dl><dt><a name="-determine_float_precision"><strong>determine_float_precision</strong></a>()</dt><dd><tt>Returns&nbsp;a&nbsp;tuple&nbsp;(significant_digits,&nbsp;max_exponent)&nbsp;for&nbsp;the&nbsp;float&nbsp;type.</tt></dd></dl>
 <dl><dt><a name="-encode"><strong>encode</strong></a>(obj, strict<font color="#909090">=False</font>, compactly<font color="#909090">=True</font>, escape_unicode<font color="#909090">=False</font>, encoding<font color="#909090">=None</font>)</dt><dd><tt>Encodes&nbsp;a&nbsp;Python&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;into&nbsp;a&nbsp;<a href="#JSON">JSON</a>-encoded&nbsp;string.<br>
&nbsp;<br>
If&nbsp;'strict'&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;then&nbsp;only&nbsp;strictly-conforming&nbsp;<a href="#JSON">JSON</a><br>
output&nbsp;will&nbsp;be&nbsp;produced.&nbsp;&nbsp;Note&nbsp;that&nbsp;this&nbsp;means&nbsp;that&nbsp;some&nbsp;types<br>
of&nbsp;values&nbsp;may&nbsp;not&nbsp;be&nbsp;convertable&nbsp;and&nbsp;will&nbsp;result&nbsp;in&nbsp;a<br>
<a href="#JSONEncodeError">JSONEncodeError</a>&nbsp;exception.<br>
&nbsp;<br>
If&nbsp;'compactly'&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;then&nbsp;the&nbsp;resulting&nbsp;string&nbsp;will<br>
have&nbsp;all&nbsp;extraneous&nbsp;white&nbsp;space&nbsp;removed;&nbsp;if&nbsp;False&nbsp;then&nbsp;the<br>
string&nbsp;will&nbsp;be&nbsp;"pretty&nbsp;printed"&nbsp;with&nbsp;whitespace&nbsp;and&nbsp;indentation<br>
added&nbsp;to&nbsp;make&nbsp;it&nbsp;more&nbsp;readable.<br>
&nbsp;<br>
If&nbsp;'escape_unicode'&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;then&nbsp;all&nbsp;non-ASCII&nbsp;characters<br>
will&nbsp;be&nbsp;represented&nbsp;as&nbsp;a&nbsp;unicode&nbsp;escape&nbsp;sequence;&nbsp;if&nbsp;False&nbsp;then<br>
the&nbsp;actual&nbsp;real&nbsp;unicode&nbsp;character&nbsp;will&nbsp;be&nbsp;inserted.<br>
&nbsp;<br>
If&nbsp;no&nbsp;encoding&nbsp;is&nbsp;specified&nbsp;(encoding=None)&nbsp;then&nbsp;the&nbsp;output&nbsp;will<br>
either&nbsp;be&nbsp;a&nbsp;Python&nbsp;string&nbsp;(if&nbsp;entirely&nbsp;ASCII)&nbsp;or&nbsp;a&nbsp;Python&nbsp;unicode<br>
string&nbsp;type.<br>
&nbsp;<br>
However&nbsp;if&nbsp;an&nbsp;encoding&nbsp;name&nbsp;is&nbsp;given&nbsp;then&nbsp;the&nbsp;returned&nbsp;value&nbsp;will<br>
be&nbsp;a&nbsp;python&nbsp;string&nbsp;which&nbsp;is&nbsp;the&nbsp;byte&nbsp;sequence&nbsp;encoding&nbsp;the&nbsp;<a href="#JSON">JSON</a><br>
value.&nbsp;&nbsp;As&nbsp;the&nbsp;default/recommended&nbsp;encoding&nbsp;for&nbsp;<a href="#JSON">JSON</a>&nbsp;is&nbsp;UTF-8,<br>
you&nbsp;should&nbsp;almost&nbsp;always&nbsp;pass&nbsp;in&nbsp;encoding='utf8'.</tt></dd></dl>
 <dl><dt><a name="-extend_and_flatten_list_with_sep"><strong>extend_and_flatten_list_with_sep</strong></a>(orig_seq, extension_seq, separator<font color="#909090">=''</font>)</dt></dl>
 <dl><dt><a name="-extend_list_with_sep"><strong>extend_list_with_sep</strong></a>(orig_seq, extension_seq, sepchar<font color="#909090">=''</font>)</dt></dl>
 <dl><dt><a name="-isnumbertype"><strong>isnumbertype</strong></a>(obj)</dt><dd><tt>Is&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;of&nbsp;a&nbsp;Python&nbsp;number&nbsp;type&nbsp;(excluding&nbsp;complex)?</tt></dd></dl>
 <dl><dt><a name="-isstringtype"><strong>isstringtype</strong></a>(obj)</dt><dd><tt>Is&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;of&nbsp;a&nbsp;Python&nbsp;string&nbsp;type?</tt></dd></dl>
 <dl><dt><a name="-skipstringsafe"><strong>skipstringsafe</strong></a>(s, start<font color="#909090">=0</font>, end<font color="#909090">=None</font>)</dt></dl>
 <dl><dt><a name="-skipstringsafe_slow"><strong>skipstringsafe_slow</strong></a>(s, start<font color="#909090">=0</font>, end<font color="#909090">=None</font>)</dt></dl>
 <dl><dt><a name="-surrogate_pair_as_unicode"><strong>surrogate_pair_as_unicode</strong></a>(c1, c2)</dt><dd><tt>Takes&nbsp;a&nbsp;pair&nbsp;of&nbsp;unicode&nbsp;surrogates&nbsp;and&nbsp;returns&nbsp;the&nbsp;equivalent&nbsp;unicode&nbsp;character.<br>
&nbsp;<br>
The&nbsp;input&nbsp;pair&nbsp;must&nbsp;be&nbsp;a&nbsp;surrogate&nbsp;pair,&nbsp;with&nbsp;c1&nbsp;in&nbsp;the&nbsp;range<br>
U+D800&nbsp;to&nbsp;U+DBFF&nbsp;and&nbsp;c2&nbsp;in&nbsp;the&nbsp;range&nbsp;U+DC00&nbsp;to&nbsp;U+DFFF.</tt></dd></dl>
 <dl><dt><a name="-unicode_as_surrogate_pair"><strong>unicode_as_surrogate_pair</strong></a>(c)</dt><dd><tt>Takes&nbsp;a&nbsp;single&nbsp;unicode&nbsp;character&nbsp;and&nbsp;returns&nbsp;a&nbsp;sequence&nbsp;of&nbsp;surrogate&nbsp;pairs.<br>
&nbsp;<br>
The&nbsp;output&nbsp;of&nbsp;this&nbsp;function&nbsp;is&nbsp;a&nbsp;tuple&nbsp;consisting&nbsp;of&nbsp;one&nbsp;or&nbsp;two&nbsp;unicode<br>
characters,&nbsp;such&nbsp;that&nbsp;if&nbsp;the&nbsp;input&nbsp;character&nbsp;is&nbsp;outside&nbsp;the&nbsp;BMP&nbsp;range<br>
then&nbsp;the&nbsp;output&nbsp;is&nbsp;a&nbsp;two-character&nbsp;surrogate&nbsp;pair&nbsp;representing&nbsp;that&nbsp;character.<br>
&nbsp;<br>
If&nbsp;the&nbsp;input&nbsp;character&nbsp;is&nbsp;inside&nbsp;the&nbsp;BMP&nbsp;then&nbsp;the&nbsp;output&nbsp;tuple&nbsp;will&nbsp;have<br>
just&nbsp;a&nbsp;single&nbsp;character...the&nbsp;same&nbsp;one.</tt></dd></dl>
 <dl><dt><a name="-utf32be_decode"><strong>utf32be_decode</strong></a>(obj, errors<font color="#909090">='strict'</font>)</dt><dd><tt>Decodes&nbsp;a&nbsp;UTF-32BE&nbsp;byte&nbsp;string&nbsp;into&nbsp;a&nbsp;Unicode&nbsp;string.</tt></dd></dl>
 <dl><dt><a name="-utf32be_encode"><strong>utf32be_encode</strong></a>(obj, errors<font color="#909090">='strict'</font>)</dt><dd><tt>Encodes&nbsp;a&nbsp;Unicode&nbsp;string&nbsp;into&nbsp;a&nbsp;UTF-32BE&nbsp;encoded&nbsp;byte&nbsp;string.</tt></dd></dl>
 <dl><dt><a name="-utf32le_decode"><strong>utf32le_decode</strong></a>(obj, errors<font color="#909090">='strict'</font>)</dt><dd><tt>Decodes&nbsp;a&nbsp;UTF-32LE&nbsp;byte&nbsp;string&nbsp;into&nbsp;a&nbsp;Unicode&nbsp;string.</tt></dd></dl>
 <dl><dt><a name="-utf32le_encode"><strong>utf32le_encode</strong></a>(obj, errors<font color="#909090">='strict'</font>)</dt><dd><tt>Encodes&nbsp;a&nbsp;Unicode&nbsp;string&nbsp;into&nbsp;a&nbsp;UTF-32LE&nbsp;encoded&nbsp;byte&nbsp;string.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>__author__</strong> = 'Deron Meranda &lt;http://deron.meranda.us/&gt;'<br>
<strong>__credits__</strong> = 'Copyright (c) 2006-2008 Deron E. Meranda &lt;http:/...m.  If not, see &lt;http://www.gnu.org/licenses/&gt;.<font color="#c040c0">\n\n</font>'<br>
<strong>__date__</strong> = '2008-03-19'<br>
<strong>__version__</strong> = '1.3'<br>
<strong>content_type</strong> = 'application/json'<br>
<strong>decimal</strong> = None<br>
<strong>file_ext</strong> = 'json'<br>
<strong>float_maxexp</strong> = 307<br>
<strong>float_sigdigits</strong> = 15<br>
<strong>hexdigits</strong> = '0123456789ABCDEFabcdef'<br>
<strong>i</strong> = 31<br>
<strong>inf</strong> = inf<br>
<strong>nan</strong> = nan<br>
<strong>neginf</strong> = -inf<br>
<strong>octaldigits</strong> = '01234567'<br>
<strong>undefined</strong> = demjson.undefined<br>
<strong>unsafe_string_chars</strong> = '"<font color="#c040c0">\\\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f</font>'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Deron&nbsp;Meranda&nbsp;&lt;<a href="http://deron.meranda.us/">http://deron.meranda.us/</a>&gt;</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Copyright&nbsp;(c)&nbsp;2006-2008&nbsp;Deron&nbsp;E.&nbsp;Meranda&nbsp;&lt;<a href="http://deron.meranda.us/">http://deron.meranda.us/</a>&gt;<br>
Licensed&nbsp;under&nbsp;GNU&nbsp;GPL&nbsp;3.0&nbsp;or&nbsp;later.&nbsp;&nbsp;See&nbsp;LICENSE.txt&nbsp;included&nbsp;with&nbsp;this&nbsp;software.<br>
&nbsp;<br>
This&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify<br>
it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by<br>
the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or<br>
(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.<br>
&nbsp;<br>
This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,<br>
but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of<br>
MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the<br>
GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.<br>
&nbsp;<br>
You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License<br>
along&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.<br>
&nbsp;<br>
</td></tr></table>
</body></html>